package org.scohen.juploadr.uploadapi.flickrrest.authentication;

import java.util.SortedMap;
import java.util.TreeMap;

import org.scohen.juploadr.uploadapi.ProtocolException;
import org.scohen.juploadr.uploadapi.flickrrest.DefaultFlickrHandler;
import org.scohen.juploadr.uploadapi.flickrrest.FlickrMethod;
import org.scohen.juploadr.uploadapi.flickrrest.RestFlickrApi;

public class GetFrob extends FlickrMethod {
    private String frob;

    public DefaultFlickrHandler getResponseHandler() {
        return new GetFrobHandler(this);
    }

    public SortedMap<String, String> getParams() {
        SortedMap<String, String> params = new TreeMap<String, String>();
        params.put("method", "flickr.auth.getFrob");
        params.put("api_key", RestFlickrApi.FLICKR_API_KEY);
        return params;
    }

    /**
     * @return Returns the frob.
     */
    public String getFrob() {
        return frob;
    }

    /**
     * @param frob
     *            The frob to set.
     */
    public void setFrob(String frob) {
        this.frob = frob;
    }

    public boolean isAuthorized() {
        return false;
    }

    @Override
    protected ProtocolException buildProtocolException(int errorCode) {
        // this method doesn't throw any exceptions other than the default.
        return null;
    }

}
